home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 2 / MacMania 2.toast / Demo's / Tools&Utilities / Programming / AD Programmer package / Programming Examples / Bouncing Ball in C / Sounds.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-12  |  1.9 KB  |  69 lines  |  [TEXT/KAHL]

  1. /*
  2.     Sounds.h
  3.     
  4.     Interface to Sounds.c
  5.     
  6.     A module to provide simple sound playing for After Dark modules.
  7.     
  8.     by Patrick C. Beard.
  9.         
  10.     7/5/90 - One shot sound, returning handle to a structure that keeps information
  11.     about the operating sound manager.
  12.     
  13.     3/20/91 - Sound under A/UX 2.0.1 is not as we thought.  It is based on
  14.     system 6.0.7, and yet the sound manager doesn't support multiple channels of
  15.     sound.  Nuts.  Need to use Gestalt to check for the sound input/output manager
  16.     instead of testing the system version.
  17.     
  18.     3/28/91 - Modifying interfaces to use call backs provided by After Dark.  Requires
  19.     addition of GMParams
  20.     
  21.     Copyright © 1990, 91 Berkeley Systems, Inc.
  22.  */
  23.  
  24. #ifndef __SOUNDS__
  25. #define __SOUNDS__
  26.  
  27. #if THINK_C == 1
  28.  
  29. #include <SoundMgr.h>
  30. typedef ProcPtr SndCallBackProcPtr;
  31.  
  32. #else
  33.  
  34. #ifndef __SOUND__
  35. #include <Sound.h>
  36. #endif
  37. #ifndef __OSUTILS__
  38. #include <OSUtils.h>
  39. #endif
  40.  
  41. #endif
  42.  
  43. #ifndef __GRAPHICSMODULE_TYPES__
  44. #include "GraphicsModule_Types.h"
  45. #endif
  46.  
  47. #ifndef nil
  48. #define nil 0L
  49. #endif
  50.  
  51. struct SoundInfo {
  52.     long privateData;            /* private storage. */
  53.     Boolean soundDisabled;        /* we can't play sound for various reasons. */
  54.     Boolean    hasSoundIOManager;    /* we can call SndChannelStatus if true. */
  55.     Boolean hasPowerManager;    /* if a portable, then we have the power manager. */
  56. };
  57.  
  58. typedef struct SoundInfo SoundInfo, **SoundInfoHandle;
  59.  
  60. extern pascal SoundInfoHandle OpenSound(GMParamBlockPtr params);
  61. extern pascal void CloseSound(SoundInfoHandle info, SndChannelPtr channel);
  62. extern pascal void PlaySound(SoundInfoHandle info, SndChannelPtr channel, Handle sound);
  63. extern pascal void QuietSound(SoundInfoHandle info, SndChannelPtr channel);
  64. extern pascal void FlushSound(SoundInfoHandle info, SndChannelPtr channel);
  65. extern pascal long GetSoundLength(SoundInfoHandle info, Handle sound);
  66. extern pascal Boolean SoundBusy(SoundInfoHandle info, SndChannelPtr channel);
  67.  
  68. #endif
  69.